#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM registry.cn-shanghai.aliyuncs.com/kfpt/sdk:3.1 AS build
WORKDIR /src

COPY . .
WORKDIR "/src/PaaS.Spread.WebAPI"

# RUN dotnet build "_appname.csproj" --source "http://121.41.197.240:6088/nuget" --source "https://api.nuget.org/v3/index.json" -c Release -o /app/publish

RUN dotnet publish "PaaS.Spread.WebAPI.csproj" --source "http://121.41.197.240:6088/nuget" \ 
    --source "https://api.nuget.org/v3/index.json" -c Release -o /app/publish 


# Reducing the size of the image
FROM registry.cn-shanghai.aliyuncs.com/kfpt/aspnet:3.1.31
WORKDIR /app
COPY --from=build /app/publish . 
EXPOSE _port

ENTRYPOINT ["./PaaS.Spread.WebAPI"]
